// 首页块接口
import httpRequest from '@/common/request/index.js';
const _request = new httpRequest();

/**
 * @description 商品列表
 */
export function goodsList(data) {
    return _request.post('/item/list', data)
}

/**
 * @description 品牌列表-共用
 */
export function brandList(data) {
    return _request.post('/item/brand/list', data)
}

/**
 * @description 轮播图
 */
export function bannerList(data) {
    return _request.get('/banner/list', data)
}

/**
 * @description 商品详情
 */
export function itemDetail(data) {
    return _request.get('/item/detail', data)
}

/**
 * @description 收藏商品
 */
export function addFavoritesGroup(data) {
    return _request.post('/userFavorite/addFavoritesGroup', data)
}

/**
 * @description 取消收藏
 */
export function userFavoriteDelete(data) {
    return _request.post('/userFavorite/delete', data)
}


/**
 * @description 分类列表支持筛选-共用
 */
export function categorySearch(data) {
	return _request.post('/item/category/list', data)
    // return _request.post('/item/category/list/by/search', data)
}


/**
 * @description 热门搜索
 */
export function searchHot(data) {
    return _request.get('/item/search/hot', data)
}


/**
 * @description 搜索历史
 */
export function searchHistory(data) {
    return _request.get('/item/search/history', data)
}


/**
 * @description 清除搜索历史
 */
export function emptyHistory(data) {
    return _request.get('/item/empty/history', data)
}


/**
 * @description app最新版本配置
 */
export function getAppVersion(data) {
    return _request.post('/sys/get/version/config', data)
}
